#pragma once

#include <typedef.h>

class TaskRun
{
public:
	TaskRun(int priority, int stackSize, const char* taskName, int cpuId = 0);
	virtual ~TaskRun();
	virtual void Start(void* arg = nullptr);

	static void RtosTask(void* arg);
	static void* PthreadTaskRun(void* arg);
	static void PthreadCreateTask(TaskRun* task);

	static void mSleep(uint32_t ms);

protected:
	virtual void Run(void* arg) = 0;

protected:
	int m_Priority;

private:
	bool m_Running;
	int m_StackSize;
	int m_CpuId;
	std::string m_TaskName;
	void* m_TaskArg;
};